$(document).ready(function(){
    $(".left>div:nth-child(2)").css("display","none");
    $(".left>div:nth-child(3)").css("display","none");
    $(".left>div:nth-child(4)").css("display","none");
    $(".btn>div:nth-child(1)").css("backgroundColor","greenyellow");
    
    $("#yzmPic").click(function(){
        var date = new Date();
        $(this).attr("src","./GetCodeServlet.do?action=getCode&date="+date);
    });
});
var i=2;
function change(){
    // 每变化一次想让所有图片清除，并让所有小圆点恢复初始状态
    $(".left>div:lt(4)").css("display","none");
    $(".btn>div").css("backgroundColor","rgb(209, 195, 195)");
    if(i>4){
        i=1;
    }
    //第i个图片显示，第i个按钮变色
    $(".left>div:nth-child("+i+")").css("display","block");
    $(".btn>div:nth-child("+i+")").css("backgroundColor","greenyellow");
    i++;
}
window.setInterval("change()",2000);